<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>location对象</title>
</head>
<body>

<input type="button" value="获取URL" id="i1">
<input type="button" value="获取参数" id="i2">
<input type="button" value="页面刷新" id="i3">

<script !src="">
  // http://www.baidu.com?username=zhangsan&password=123456


  // window.location.href // 获取和修改浏览器的完整请求地址 url   http://www.baidu.com?username=zhangsan&password=123456
  // window.location.search // 获取浏览器地址后面的参数  username=zhangsan&password=123456
  // window.location.reload() // 重新加载当前文档，【刷新】

  console.log(window.location)
  console.log(window.location.href)
  console.log(window.location.search)


  i1.onclick = function () {
    // alert(window.location.href)
    location.href = "http://www.douyin.com"
  }

  i2.onclick = function () {
    alert(window.location.search)
  }

  i3.onclick = function () {
    window.location.reload();
  }


</script>


</body>
</html>